package com.openbravo.pos.customers;

import com.openbravo.basic.BasicException;
import com.openbravo.data.gui.ListCellRendererBasic;
import com.openbravo.data.loader.ComparatorCreator;
import com.openbravo.data.loader.TableDefinition;
import com.openbravo.data.loader.Vectorer;
import com.openbravo.data.user.EditorRecord;
import com.openbravo.data.user.ListProvider;
import com.openbravo.data.user.ListProviderCreator;
import com.openbravo.data.user.SaveProvider;
import com.openbravo.pos.forms.AppLocal;
import com.openbravo.pos.forms.AppView;
import com.openbravo.pos.panels.JPanelTable;
import javax.swing.ListCellRenderer;

public class CustomersPanel extends JPanelTable
{
  private TableDefinition tcustomers;
  private CustomersView jeditor;

  protected void init()
  {
    DataLogicCustomers localDataLogicCustomers = (DataLogicCustomers)this.app.getBean("com.openbravo.pos.customers.DataLogicCustomers");
    
    
    this.tcustomers = localDataLogicCustomers.getTableCustomers();
    this.jeditor = new CustomersView(this.app, this.dirty);
  }

  public void activate()
    throws BasicException
  {
    this.jeditor.activate();
    super.activate();
  }

  public ListProvider getListProvider()
  {
    return new ListProviderCreator(this.tcustomers);
  }

  public SaveProvider getSaveProvider()
  {
    return new SaveProvider(this.tcustomers, new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 });
  }

  public Vectorer getVectorer()
  {
    return this.tcustomers.getVectorerBasic(new int[] { 1, 2, 3, 4 });
  }

  public ComparatorCreator getComparatorCreator()
  {
    return this.tcustomers.getComparatorCreator(new int[] { 1, 2, 3, 4 });
  }

  public ListCellRenderer getListCellRenderer()
  {
    return new ListCellRendererBasic(this.tcustomers.getRenderStringBasic(new int[] { 3 }));
  }

  public EditorRecord getEditor()
  {
    return this.jeditor;
  }

  public String getTitle()
  {
    return AppLocal.getIntString("Menu.CustomersManagement");
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.customers.CustomersPanel
 * JD-Core Version:    0.6.0
 */